package com.ccys.doctor.controller;

import com.ccys.common.vo.ResponseResultApp;
import com.ccys.db.dto.doctor.flag.CreateFlagPatientDto;
import com.ccys.db.vo.doctor.flag.GetFlagPatientVo;
import com.ccys.doctor.service.FlagService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: WhiteCoat
 * @description: 病人标签相关接口
 * @author: ZhangJingCan
 * @create: 2024-02-05 13:51
 **/
@RestController
@Api(tags = "病人标签相关接口")
@RequestMapping("flagReason")
public class FlagController {

    @Autowired
    private FlagService flagService;

    /**
     * 触发时机:在聊天频道、患者列表、综述、视频会议和离线咨询页面中获取标志
     *
     * @param type       标签类型
     * @param member_id  用户id
     * @param keyword    模糊查询字段
     * @param page_index 页数
     * @param page_size  条数
     * @return
     */
    @ApiOperation("按条件获取患者标签记录")
    @GetMapping(value = "/GetFlagPatient")
    public ResponseResultApp<GetFlagPatientVo> getFlagPatient(String type, String member_id, String keyword, Integer page_index, Integer page_size) {
        return flagService.getFlagPatient(type, member_id, keyword, page_index, page_size);
    }

    /**
     * 触发时机：医生给患者打标签
     * @param dto
     * @return
     */
    @ApiOperation("新增患者标签记录")
    @PostMapping(value = "/CreateFlagPatient")
    public ResponseResultApp<GetFlagPatientVo> createFlagPatient(@RequestBody CreateFlagPatientDto dto) {
        return flagService.createFlagPatient(dto);
    }



}
